package org.application.calculator.logic;

public class Negation implements Node{

private Node son;
	
	public Negation(Node son){
		this.son = son;
	}
	
	@Override
	public String toString(){
		if (son.evaluate() != 0){
		return "( - " + son.toString() + " )";
		}else{
			return "0.0";
		}
	}
	
	public double evaluate(){
		return - son.evaluate();
	}
}
